import request from '@/utils/request'

export function getNestedTreeList(courseId) {
  return request({
    url: `/admin/edu/chapter/nestedList/${courseId}`,
    method: 'get'
  })
}

export function removeById(id) {
  return request({
    url: `/admin/edu/chapter/remove/${id}`,
    method: 'delete'
  })
}

export function save(chapter) {
  return request({
    url: '/admin/edu/chapter/save',
    method: 'post',
    data: chapter
  })
}

export function getById(id) {
  return request({
    url: `/admin/edu/chapter/get/${id}`,
    method: 'get'
  })
}

export function updateById(chapter) {
  return request({
    url: '/admin/edu/chapter/update',
    method: 'put',
    data: chapter
  })
}
